# -*- coding: utf-8 -*-

import urllib, re
page = urllib.urlopen("http://2ip.ru").read()#[600:800]
print re.findall('<big>.*</big>', page)[0][5:-6]

print re.findall('<th> .* </th>', page)




import os, cookielib
import httplib
import re,sys,urllib,urllib2
cookie = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookie))
headers = {'User-Agent' : 'Mozilla/5.0'}
request = urllib2.Request('http://vk.com/login.php?email=sere9a.nick@mail.ru&pass=AOEyjMUF', None, headers)
response = urllib2.urlopen(request)
s=response.read().decode('cp1251')
print s




print'\nvk.com'
page = urllib.urlopen("http://vk.com/rocknstar").read()#[600:800]
print 'User:', re.findall('<title>.*</title>', page)[0][7:-8]
print re.findall('<span class="inl_bl left_count">.*</span>', page)
print re.findall(r'>.*</div>', page)[-8]#[-7]
3712
